using StudentVideo.Client.Common.Interfaces;
using StudentVideo.Client.Handler;
using StudentVideo.Shared.Models;
using StudentVideo.Shared.Dtos.Student;

namespace StudentVideo.Client.Routers;

public class StudentRouter(HttpHandler HttpHandler): IHttpRouter {
   public HttpHandler _http { get; set; } = HttpHandler;

   public async Task<HttpResult> Create(StudentCreateRequest data) {
      return await _http.PostAsync("/Student/Create", data);
   }

   public async Task<HttpResult<StudentFindResult>> Find(StudentFindRequest data) {
      return await _http.PostAsync<StudentFindResult>("/student/find", data);
   }

   public async Task<HttpResult> Del(StudentDelRequest data) {
      return await _http.PostAsync("/student/del", data);
   }
}
